package com.zlx.guguanjia.controller;



import com.github.pagehelper.PageInfo;
import com.zlx.guguanjia.entity.Result;
import com.zlx.guguanjia.entity.SysLog;
import com.zlx.guguanjia.service.SysLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @Author 周罗校
 * @Description
 * @ClassName SysLogController
 * @date 2020.11.09 16:29:28
 * 该版权归周罗校所有，最终解释权以官方为准
 */
@RestController
@RequestMapping("/manager/log/")
public class SysLogController {
    @Autowired
    private SysLogService service;


    @GetMapping("selectPage/{start}/{pageSize}")
    public Result selectPage(@PathVariable("start") int start, @PathVariable("pageSize") int pageSize,@RequestParam Map<String,Object> condition) {
        PageInfo<SysLog> sysAreaPageInfo = service.selectPage(start, pageSize, condition);
        return new Result(sysAreaPageInfo);
    }

    @PutMapping("deleteById/{id}")
    public Result deleteById(@PathVariable("id") Long id){
        return new Result(true,"删除成功",service.deleteByPrimaryKey(id));
    }
}
